London | 26-ITP-May | Anita Amirhaeri | Sprint 1 | Structuring-and-Testing-Data - #1566
Open
anitahy73 wants to merge 10 commits into
Open
London | 26-ITP-May | Anita Amirhaeri | Sprint 1 | Structuring-and-Testing-Data#1566anitahy73 wants to merge 10 commits into
anitahy73 wants to merge 10 commits into
Conversation
Added a comment explaining the increment operation on the count variable.
Updated the initials variable to dynamically extract the first characters from firstName, middleName, and lastName.
Log the randomly generated number to the console.
Added comments to provide instructions for the first activity.
Added comments to explain variable declarations and expressions.
Added comments to explain variable usage and code functionality.
Added comments explaining the purpose of each step in the code.
cjyuan
reviewed
Jul 27, 2026
cjyuan
left a comment
Contributor
There was a problem hiding this comment.
You missed updating 4 files in Sprint-1/2-mandatory-errors.
| c) It is taking the movieLength and doing a remainder that is showing what is left after the vaule has been divided, in this case wil be 84. | ||
| I found the info here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder | ||
| d) It is removing any extra seconds from the division by 60 so that is is showing as whole numbers without decimals. | ||
| e) Result is showing the movies duration but broken down to hours:minutes:seconds, I think it should be movieDuration to help describe it better. |
Contributor
There was a problem hiding this comment.
The name movieDuration does not quite indicate the value stored in the variable
is a formatted string in the form "2:12:02".
Could you suggest a more descriptive name?
Author
There was a problem hiding this comment.
I can suggest movieFullDuration
Contributor
There was a problem hiding this comment.
Ideally the name could suggest the value is a string (and not a number). For example, add a "formatted" prefix or "Str" suffix.
Added detailed comments explaining the random number generation process.
cjyuan
reviewed
Aug 1, 2026
cjyuan
left a comment
Contributor
There was a problem hiding this comment.
Changes look good. Well done.
| // Math.random() : Generates a pseudorandom decimal number. [0, 1) | ||
| // Math.random() * (maximum - minimum + 1) : Scales the random value so its width equals the number of integers from `minimum` to `maximum`. [0, maximum - minimum + 1) | ||
| // Math.floor(Math.random() * (maximum - minimum + 1)) : Floors the scaled value, producing a random integer starting at 0. Integers in [0, maximum - minimum + 1), i.e. {0, 1, ..., maximum - minimum} | ||
| // Math.floor(Math.random() * (maximum - minimum + 1)) + minimum` : Shifts the previous result upward by `minimum`, producing a random integer between `minimum` and `maximum`, inclusive. Integers in [minimum, maximum + 1), i.e. {minimum, minimum + 1, ..., maximum} |
Contributor
There was a problem hiding this comment.
Note: For integers, [minimum, maximum + 1) could also be expressed as [minimum, maximum].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Sprint 1 tasks
Questions